export const drawerTitle = ref("");
export const drawerLoading = ref(false);
export const drawerVisible = ref(false);
export const drawerInstance = ref<any>(null);
export const drawerFormState = reactive({});
export const resetFormState = (formState) => {
  const defaultFormState = reactive({});
  Object.keys(defaultFormState).forEach(
    (key) => (formState[key] = defaultFormState[key])
  );
};
resetFormState(drawerFormState);
import { showModal, tmp_imageUrl } from ".";
import styles from "./index.module.less";
import { modalTitle } from "./modal";
export const drawerConfig = () => {
  const defineDrawer = {
    drawerInstance,
    loading: drawerLoading,
    visible: drawerVisible,
    title: drawerTitle,
    maskClosable: true,
    width: 800,
    formState: drawerFormState,
    slot: {
      extra_form_item: () => (
        <div>
          <tips-card
            title={"客户资料审核说明"}
            content={[
              "1.主图未通过审核时，将不会被推荐给其他客户（默认头像/上一张）。副图未通过审核时将不会对外展示，仅客户自己可见",
              "2.个性视频未通过审核时将不会对外展示",
            ]}
          />
          <s-title>审核信息</s-title>
          <div class={styles.check_info}>
            <div class={styles.flex_row}>
              <div class={styles.flex_column}>
                <div class={styles.avatar_wrap}>
                  <a-image class={styles.img} src={tmp_imageUrl} />
                  <span class={[styles.tag]}>副图</span>
                </div>
              </div>
              <i class={["s-ffbb00", styles.status]}>待审核</i>
            </div>
            <a-row>
              <a-col span={8}>
                <div
                  class="s-table-body_cell"
                  style="justify-content: flex-start; align-items: flex-start;"
                >
                  <span>客户：</span>
                  {renderUserInfo({
                    record: {
                      avatar: tmp_imageUrl,
                      nickname: "jerry_test",
                      uid: "123456789",
                      sex: 1,
                    },
                  })}
                </div>
              </a-col>
              <a-col span={8}>场景名称：客户资料</a-col>
              <a-col span={8}>内容ID: 123456789</a-col>
            </a-row>
            <a-row>
              <a-col span={8}>内容类型：图片</a-col>
              <a-col span={8}>上传时间：2024/03/04 00:00:00</a-col>
              <a-col span={8}>审核时间：2024/03/04 23:59:59</a-col>
            </a-row>
            <a-row>
              <a-col span={24}>
                <div
                  class="s-table-body_cell"
                  style="justify-content: flex-start; align-items: flex-start;"
                >
                  <span>审核人员：</span>
                  {renderUserInfo({
                    record: {
                      avatar: tmp_imageUrl,
                      nickname: "jerry_test",
                      uid: "123456789",
                      sex: 1,
                    },
                  })}
                </div>
              </a-col>
            </a-row>
            <a-row>
              <a-col span={24}>
                审核依据：
                <a-space size={8}>
                  <a-tag color="#ff0000" style="padding: 2px 4px;margin:0;">
                    涉黄
                  </a-tag>
                  <span>请重新上传你的头像副图！！！</span>
                </a-space>
              </a-col>
            </a-row>
          </div>
          <s-title>审核结果</s-title>
          <div class={styles.check_result}>
            <a-row>
              <a-col span={24}>
                <a-space size={8}>
                  <a-tag color="pink" style="padding: 2px 4px;margin:0;">
                    封禁账号
                  </a-tag>
                  <span>封禁99天，剩余36天（2024-09-19）</span>
                </a-space>
              </a-col>
            </a-row>
          </div>
          <s-title>审核历史</s-title>
          <div class={styles.check_history}>
            <s-table />
          </div>
        </div>
      ),
      extra: () => {
        return (
          <a-space size={8}>
            <s-button
              type="danger"
              onClick={() => {
                modalTitle.value = "内容违规";
                showModal();
              }}
            >
              违规
            </s-button>
            <s-button type="primary">正常</s-button>
          </a-space>
        );
      },
    },
  };
  return defineDrawer;
};
